<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:include="common">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button class="btn btn-primary btn-lg" onclick="orderTime(1)">以开始时间正序排序</button>
<button class="btn btn-primary btn-lg" onclick="orderTime(2)">以开始时间倒序排序</button>
<table id="myTable"></table>
</body>
<script>
    $(function (){
        queryList();
    })
    var or = 0;

    function orderTime(a){
        or = a;
        $("#myTable").bootstrapTable("refresh",{
            "query":{
                "sortTime": or
            }
        })
    }

    /*查询预期的商品*/
   function queryList(){
       $('#myTable').bootstrapTable({
           url: '/orders/expectGoods',
           columns: [{ field: 'goodsImg',title: '商品图片',
               formatter:function(value,row,index) {
                   return '<img height="100" width="100" src="' + value + '"/>';
               }
           },
               { field: 'goodsId',  title: '商品ID' },
               {field: 'goodsName', title: '商品名称'},
               { field: 'goodsType',title: '类型',
                   formatter:function(value,row,index){
                       return row.goodsType==1? "线上":"线下";
                   }},
               { field: 'goodsStartTime',title: '开始时间'},
               { field: 'goodsEndTime',title: '结束时间'},
               { field: 'goodsPutTime',title: '上架时间'},
               { field: 'cityName',title: '城市名字'},
               { field: 'truePrice',title: '成本价格'},
               { field: 'goodsMainActor',title: '主要演员'},
               { field: 'goodsDuration',title: '演出时长'}

           ],
           pagination:true,
           pageSize:2,
           pageList:[2,4,6,8,10],
           sidePagination : 'client',//server:服务器端分页{rows:[],total:10}|client：前端分页 [{},{}]
       })
   }
</script>
</html>